﻿CREATE PROCEDURE [dbo].[sp_CreateTemplateComponent] 
    @componentClassId		nvarchar(128), 
	@componentName			nvarchar(256), 
	@templateId				int, 
	@componentUri			nvarchar(2048),
	@componentType			nvarchar(64),
	@rowsetDescriptorType	nvarchar(128) = 'None',
	@containsMappings		bit,
	@containsCollections	bit
AS 
BEGIN
	INSERT INTO TemplateComponents
	(ComponentClassId, ComponentName, TemplateId, ComponentUri,
	ComponentType, RowsetDescriptorType, ContainsMappings, ContainsCollections)
	VALUES (
		@componentClassId, 
		@componentName, 
		@templateId, 
		@componentUri,
		@componentType,
		@rowsetDescriptorType,
		@containsMappings,
		@containsCollections);

	SELECT SCOPE_IDENTITY();
END


